// 图片URL拼接处理函数
export function picUrlConstruct(url) {
  if (!url) {
    return '';
  }
  
  // 如果已经是完整的URL，直接返回
  if (url.startsWith('http://') || url.startsWith('https://')) {
    return url;
  }
  
  // 确保URL以/开头
  const normalizedUrl = url.startsWith('/') ? url : '/' + url;
  
  let newUrl = 'https://' + constant.domainUrl + normalizedUrl;
  // console.log("newUrl:" + newUrl);
  return newUrl;
}

// 类型 0：小程序 1：网站
const softType = 1;

// 服务器域名配置
//const domainUrl = '127.0.0.1:8089';
const domainUrl = 'gh.hangzhouhsh.com';
//const domainUrl = '121.43.126.171:7049';

// API基础路径
const apiBaseUrl = 'https://' + domainUrl;

// 图片基础路径
const imageBaseUrl = 'https://' + domainUrl;

// 环境配置
const isDevelopment = process.env.NODE_ENV === 'development';
const isProduction = process.env.NODE_ENV === 'production';

// 分页默认配置
const pagination = {
  defaultPageSize: 10,
  pageSizes: [10, 20, 50, 100]
};

// 场所类型映射
const venueTypes = {
  1: { name: '篮球', color: 'success' },
  2: { name: '羽毛球', color: 'primary' },
  3: { name: '足球', color: 'info' },
  4: { name: '乒乓球', color: 'danger' },
  5: { name: '网球', color: 'warning' }
};

//创作者类型映射
const creatorTypes ={
  1: { name: '导演', color: 'success' },
  2: { name: '演员', color: 'primary' },
  3: { name: '网红', color: 'info' },
  4: { name: '摄影师', color: 'danger' },
  5: { name: '化妆师', color: 'warning' }

};

// 状态映射
const statusTypes = {
  0: { name: '维护中', color: 'warning' },
  1: { name: '营业中', color: 'success' }
};

const constant = {
  softType,
  domainUrl,
  apiBaseUrl,
  imageBaseUrl,
  isDevelopment,
  isProduction,
  pagination,
  venueTypes,
  statusTypes,
  creatorTypes
};

export default constant;